#include "openmove_Prefix.h"
#include "SceneBase.h"
#include "OgreEngine.h"
#include "ExampleFrameListener.h"
#include "SkeletalAnimationFrameListener.h"
#include "OgreExternalTextureSourceManager.h"
#include "OgreExternalTextureSource.h"
#include "SceneTestFur.h"
#include "SimpleFrameListener.h"

CSceneTestFur :: CSceneTestFur(COgreEngine &Creator, const String & Name, const int pos) : CSceneBase(Creator, Name, pos), m_pPluieTop(NULL)
{
}

CSceneTestFur :: ~CSceneTestFur(void)
{
}

void CSceneTestFur :: Create(TCreatorEntities const &CreatorEntities, TCreatorNodes const &CreatorNodes, TCreatorLights const &CreatorLights, ENetConfig IsClient, Vector3 &CameraStartPos)
{
	m_ShowEntitiesBBox = false;
	CSceneBase::Create(CreatorEntities, CreatorNodes, CreatorLights, IsClient, CameraStartPos);

	m_pCurrentCamera->setPosition(-180.8f, 87.7f, 452.3f);
	//Quaternion Quat(Radian(Degree(0.0f)), Vector3(0, 1, 0));
	//m_pCurrentCamera->setOrientation(Quat);
	m_pCurrentCamera->setDirection(0, 0, -1);
	m_OgreEngine.m_pViewPort->setBackgroundColour(ColourValue(0.0f, 0.0f, 0.0f, 1.0f));

	Entity *pLoup = NULL;
	for (TEntities::const_iterator It = m_Entities.begin(); It != m_Entities.end(); ++It)
	{
		if ((*It)->getName() == "peau-du-loup")
		{
			pLoup = *It;
			break;
		}
	}

	if (NULL != pLoup)
	{
		pLoup->setMaterialName("openmove.OrenNayar");
	}

	//m_OgreEngine.m_Root.addFrameListener(this);
	//m_FrameListeners.push_back(this);
}


bool CSceneTestFur :: frameStarted(const FrameEvent& evt)
{
	CSceneBase::frameStarted(evt);
	return (true);
}